#pragma once

#include <d3dx9.h>
#include "TwEngineDx.h"

// the PARTICLE class
class PARTICLE
{
public:
	PARTICLE()
	{
		position.x = 0.0f; position.y = 0.0f; position.z = 0.0f;
		velocity.x = 0.0f; velocity.y = 0.0f; velocity.z = 0.0f;
		acceleration.x = 0.01f; acceleration.y = 0.0f; acceleration.z = 0.0f;
		radius = 1.0f;
	}

	void render_particle();
	void set_particle(float camx, float camy, float camz);
	void run_particle(float seconds);

protected:
	D3DXVECTOR3 position;
	D3DXVECTOR3 velocity;
	D3DXVECTOR3 acceleration;
	float radius;
	D3DXMATRIX matRotateX;
	D3DXMATRIX matRotateY;
};



class sa_TwParticle
{
public:
	sa_TwParticle(void);
	~sa_TwParticle(void);

	void InitGraphics();

	void InitRenderState();

	void InitLight();

	void Update();

	void Render();

	void Clear();

	void render_grid();

private:
	
	LPDIRECT3DVERTEXBUFFER9 g_buffer ;    // the pointer to the grid's vertex buffer
	float camx, camy, camz;    // camera position
	PARTICLE particle;


};
